package simtester.test.pages

import geb.Module
import geb.Page

class InstancesPage extends Page {
    static url = 'instance/list'
    static at = { $('title').text() == 'SimTester - Running AWS Instances' }
    
    static content = {
        instancesTable {
            $('table tbody tr').collect {
                module InstancesRow, it
            }
        }
    }
}

class InstancesRow extends Module {
    static content = {
        cell { i -> $('td', i) }

        cloudId     { cell(0).text() }
        amiId       { cell(1).text() }
        type        { cell(2).text() }
        status      { cell(3).text() }
        dateCreated { cell(4).text() }
    }
}